﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Windows.Forms;

namespace Transformer.iHunter
{
    /// <summary>
    /// Present the interface to the filter provider, which creates filters
    /// </summary>
    public interface IFilterProvider : IPlugin
    {

        /// <summary>
        /// Creates the filter instance.
        /// </summary>
        /// <param name="info">The filter info.</param>
        /// <returns>The instance of the filter object</returns>
        IFilter CreateFilterInstance(FilterInfo info);
        
        /// <summary>
        /// Gets the filter configure editor.
        /// </summary>
        /// <returns>The configure editor.</returns>
        /// <remarks>
        /// A configure editor is a Windows Forms user control <see cref="System.Windows.Forms.UserControl"/> 
        /// and it must implement <see cref="System.Xml.Serialization.IXmlSerializable"/> interface.
        /// The user control will be shown while the user editing the settings of a channel provided by this channel provider.
        /// The <see cref="System.Xml.Serialization.IXmlSerializable"/> interface is used to set and retreive settings
        /// from the editor control.
        /// </remarks>
        UserControl GetFilterConfigureEditor();

        /// <summary>
        /// Gets the instance creating wizard pages.
        /// </summary>
        /// <returns>The wizard pages array</returns>
        /// <remarks>
        /// A wizard page is a <see cref="System.Windows.Forms.UserControl"/> object
        /// and it must implement <see cref="System.Xml.Serialization.IXmlSerializable"/> interface.
        /// The pages will be shown one by one while the user using creating a new channel using the creating wizard.
        /// The <see cref="System.Xml.Serialization.IXmlSerializable"/> interface is used to set and retreive settings
        /// from the editor control. The settings of each page will be retrieved and passed to the next page (if exists).
        /// When the last page is closed (the user clicks "Finish"), the settings will be saved in the database
        /// </remarks>
        UserControl[] GetNewFilterWizardPages();

    }
}
